package android.content;

import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;

public interface ISyncContext extends IInterface {

    class Default implements ISyncContext {
        @Override  // android.os.IInterface
        public IBinder asBinder() {
            return null;
        }

        @Override  // android.content.ISyncContext
        public void onFinished(SyncResult arg1) throws RemoteException {
        }

        @Override  // android.content.ISyncContext
        public void sendHeartbeat() throws RemoteException {
        }
    }


    public static abstract class Stub extends Binder implements ISyncContext {
        static class Proxy implements ISyncContext {
            private IBinder mRemote;
            public static ISyncContext sDefaultImpl;

            Proxy(IBinder arg1) {
                this.mRemote = arg1;
            }

            @Override  // android.os.IInterface
            public IBinder asBinder() {
                return this.mRemote;
            }

            public String getInterfaceDescriptor() {
                return "android.content.ISyncContext";
            }

            @Override  // android.content.ISyncContext
            public void onFinished(SyncResult arg6) throws RemoteException {
                Parcel v0 = Parcel.obtain();
                Parcel v1 = Parcel.obtain();
                try {
                    v0.writeInterfaceToken("android.content.ISyncContext");
                    if (arg6 == null) {
                        v0.writeInt(0);
                    } else {
                        v0.writeInt(1);
                        arg6.writeToParcel(v0, 0);
                    }

                    if (!this.mRemote.transact(1, v0, v1, 0) && Stub.getDefaultImpl() != null) {
                        Stub.getDefaultImpl().onFinished(arg6);
                        v1.recycle();
                        v0.recycle();
                        return;
                    }

                    try {
                        v1.readException();
                    } catch (Throwable v6) {
                        v1.recycle();
                        v0.recycle();
                        throw v6;
                    }
                } catch (Throwable v6) {
                    v1.recycle();
                    v0.recycle();
                    throw v6;
                }


                v1.recycle();
                v0.recycle();
            }

            @Override  // android.content.ISyncContext
            public void sendHeartbeat() throws RemoteException {
                Parcel v0 = Parcel.obtain();
                Parcel v1 = Parcel.obtain();
                try {
                    v0.writeInterfaceToken("android.content.ISyncContext");
                    if (!this.mRemote.transact(2, v0, v1, 0) && Stub.getDefaultImpl() != null) {
                        Stub.getDefaultImpl().sendHeartbeat();
                        v1.recycle();
                        v0.recycle();
                        return;
                    }

                    try {
                        v1.readException();
                    } catch (Throwable v2) {
                        v1.recycle();
                        v0.recycle();
                        throw v2;
                    }
                } catch (Throwable v2) {
                    v1.recycle();
                    v0.recycle();
                    throw v2;
                }


                v1.recycle();
                v0.recycle();
            }
        }

        private static final String DESCRIPTOR = "android.content.ISyncContext";
        static final int TRANSACTION_onFinished = 1;
        static final int TRANSACTION_sendHeartbeat = 2;

        public Stub() {
            this.attachInterface(this, "android.content.ISyncContext");
        }

        @Override  // android.os.IInterface
        public IBinder asBinder() {
            return this;
        }

        public static ISyncContext asInterface(IBinder arg2) {
            if (arg2 == null) {
                return null;
            }

            IInterface v0 = arg2.queryLocalInterface("android.content.ISyncContext");
            return v0 == null || !(v0 instanceof ISyncContext) ? new Proxy(arg2) : ((ISyncContext) v0);
        }

        public static ISyncContext getDefaultImpl() {
            return Proxy.sDefaultImpl;
        }

        @Override  // android.os.Binder
        public boolean onTransact(int arg4, Parcel arg5, Parcel arg6, int arg7) throws RemoteException {
            if (arg4 != 1) {
                if (arg4 != 2) {
                    if (arg4 != 0x5F4E5446) {
                        return super.onTransact(arg4, arg5, arg6, arg7);
                    }

                    arg6.writeString("android.content.ISyncContext");
                    return true;
                }

                arg5.enforceInterface("android.content.ISyncContext");
                this.sendHeartbeat();
                arg6.writeNoException();
                return true;
            }

            arg5.enforceInterface("android.content.ISyncContext");
            this.onFinished(arg5.readInt() == 0 ? null : ((SyncResult) SyncResult.CREATOR.createFromParcel(arg5)));
            arg6.writeNoException();
            return true;
        }

        public static boolean setDefaultImpl(ISyncContext arg1) {
            if (Proxy.sDefaultImpl == null && arg1 != null) {
                Proxy.sDefaultImpl = arg1;
                return true;
            }

            return false;
        }
    }

    void onFinished(SyncResult arg1) throws RemoteException;

    void sendHeartbeat() throws RemoteException;

}
